<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: wzm
  Date: 2023/11/13
  Time: 10:34
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
	<title>Title</title>
</head>
<body>

<center>
	<h3>部门列表页面</h3>
	<c:if test="${depts != null}">
		<table width="800px" border="1" style="text-align: center;">
		<tr>
			<td>序号</td>
			<td>部门编号</td>
			<td>部门名称</td>
			<td>部门位置</td>
			<td>操作</td>
		</tr>
			<%--遍历数据--%>
		<c:forEach items="${depts}" var="dept" varStatus="sta">
			<tr>
				<td>${sta.count}</td>
				<td>${dept.deptNo}</td>
				<td>${dept.deptName}</td>
				<td>${dept.deptLocation}</td>
				<td>
					<a href="/oa/dept/findById?id=${dept.id}&tag=detail">详情</a>
					<a href="/oa/dept/findById?id=${dept.id}&tag=update">修改</a>
					<a href="/oa/dept/delete?id=${dept.id}">删除</a>
					<%--获取项目的虚拟路径--%>
					<a href="${pageContext.request.contextPath}/dept_add.jsp">新增</a>
				</td>
			</tr>
		</c:forEach>
	</table>
	</c:if>

	<c:if test="${depts == null}">
		<h5>${error}</h5>
	</c:if>

</center>

</body>
</html>


